<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
					var number="我是全局变量";//全局变量
					function fn()
					{
						var number="我是局部变量";
						document.write("number的值是"+number+"<br>"); //就近原则
					}
					function fn2()
					{
						document.write("number的值是"+number);
					}			
					fn();
					fn2();
		</script>
	</head>
	<body>
	</body>
</html>